package 结构型模式.享元模式.图书借阅系统;

public class Client {
    public static void main(String[] args) {
        BookStyle book=BookFactory.getInstance().getBook("西游记");
        book.display(19,new User("张三"));
        BookStyle book1=BookFactory.getInstance().getBook("红楼梦");
        book1.display(32,new User("李四"));
        BookStyle book2=BookFactory.getInstance().getBook("三国演义");
        book2.display(22,new User("王麻子"));
        BookStyle book3=BookFactory.getInstance().getBook("水浒传");
        book3.display(72,new User("李小二"));
        BookStyle book4=BookFactory.getInstance().getBook("水浒传");
        book4.display(92,new User("大辞逼"));
        System.out.println("判断是否为同一个对象"+(book3==book4));
    }
}
